package com.mk.admin.controller;

import com.mk.admin.model.ResultDto;
import com.mk.admin.model.vo.RAdminDoctorVo;
import com.mk.admin.service.RAdminDoctorService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/a/adm/rAdminDoctor")
@Api(tags = "关联-账号和医生(医生，护士，药师)")
public class RAdminDoctorController {
    @Autowired
    private RAdminDoctorService rAdminDoctorService;

    @PostMapping("/add")
    public ResultDto add(@RequestBody RAdminDoctorVo vo) {
        return rAdminDoctorService.add(vo);
    }

    @PostMapping("/update")
    public ResultDto update(@RequestBody RAdminDoctorVo vo) {
        return rAdminDoctorService.update(vo);
    }

    @PostMapping("/delete")
    public ResultDto delete(@RequestBody RAdminDoctorVo vo) {
        return rAdminDoctorService.delete(vo.getId());
    }

    @PostMapping("/status")
    public ResultDto status(@RequestBody RAdminDoctorVo vo) {
        return rAdminDoctorService.status(vo.getId());
    }
}
